﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BIS.Portal.Modules.CMS.DAL;
using BIS.Portal.Modules.CMS.Entity;

namespace BIS.Portal.Modules.CMS.BO
{
    public class AdminCmsDisplayTypeBO
    {
        /// <summary>
        /// Gets all display type.
        /// </summary>
        /// <returns></returns>
        public static IList<AdminCmsDisplayTypeEntity> GetAllDisplayType()
        {
            return AdminCmsDisplayTypeDAL.GetAllDisplayType();
        }

        /// <summary>
        /// Gets the by display type id.
        /// </summary>
        /// <param name="displayTypeId">The display type id.</param>
        /// <returns></returns>
        public static AdminCmsDisplayTypeEntity GetByDisplayTypeId(int displayTypeId)
        {
            return AdminCmsDisplayTypeDAL.GetByDisplayTypeId(displayTypeId);
        }

        /// <summary>
        /// Inserts the specified CMS display type.
        /// </summary>
        /// <param name="cmsDisplayType">Display type of the CMS.</param>
        /// <returns></returns>
        public static bool Insert(AdminCmsDisplayTypeEntity cmsDisplayType)
        {
            return (AdminCmsDisplayTypeDAL.Insert(cmsDisplayType) > 0);
        }

        /// <summary>
        /// Updates the specified CMS display type.
        /// </summary>
        /// <param name="cmsDisplayType">Display type of the CMS.</param>
        /// <returns></returns>
        public static bool Update(AdminCmsDisplayTypeEntity cmsDisplayType)
        {
            return (AdminCmsDisplayTypeDAL.Update(cmsDisplayType) > 0);

        }

        /// <summary>
        /// Deletes the specified CMS display id.
        /// </summary>
        /// <param name="cmsDisplayId">The CMS display id.</param>
        /// <returns></returns>
        public static bool Delete(int cmsDisplayId)
        {
            return (AdminCmsDisplayTypeDAL.Delete(cmsDisplayId) > 0);
        }

        /// <summary>
        /// Gets the num of use other table.
        /// </summary>
        /// <param name="cmsDisplayId">The CMS display id.</param>
        /// <returns></returns>
        public static int GetNumOfUseOtherTable(int cmsDisplayId)
        {
            return AdminCmsDisplayTypeDAL.GetNumOfUseOtherTable(cmsDisplayId);
        }

        /// <summary>
        /// Updates the status.
        /// </summary>
        /// <param name="displayTypeId">The display type id.</param>
        /// <param name="status">The status.</param>
        /// <param name="LastUpdate">The last update.</param>
        /// <param name="updateBy">The update by.</param>
        /// <returns></returns>
        public static bool UpdateStatus(int displayTypeId, int status, DateTime LastUpdate, string updateBy)
        {
            return AdminCmsDisplayTypeDAL.UpdateStatus(displayTypeId, status, LastUpdate, updateBy) > 0;
        }
    }

}
